using System;
using System.Collections.Generic;
using System.Text;

using Sandia.MVCFramework.Common;
using Sandia.MVCFramework.Controller;
using Sandia.MVCFramework.DataAccessor;
using Sandia.MVCFramework.DataAnalyzer;
using Sandia.MVCFramework.DataStore;
using Sandia.MVCFramework.Plugin;
using Sandia.MVCFramework.Request;
using Sandia.MVCFramework.View;
using Sandia.MVCFramework.ViewManager;

using Sandia.MVCFramework.TestPlugin.Data;
using Sandia.MVCFramework.TestPlugin.DataAccessor;
using Sandia.MVCFramework.TestPlugin.DataAnalyzer;
using Sandia.MVCFramework.TestPlugin.DataStore;
using Sandia.MVCFramework.TestPlugin.Request;
using Sandia.MVCFramework.TestPlugin.View;
using Sandia.MVCFramework.TestPlugin.ViewManager;
using Sandia.MVCFramework.ExportTools;

namespace Sandia.MVCFramework.Plugin
{
    public class PluginImplementation: AbstractStandardPlugin
    {
        IDataAccessor dummyDataAccessor;
        IDataAnalyzer dummyDataAnalyzer;
        IDataStore dummyDataStore;
        IViewManager dummyViewManager;

        #region IPlugin Members

        public override void init(IRequestRouter requestRouter, IPublisher publisher)
        {
            this.dummyDataAccessor = new DummyDataAccessor();
            this.dummyDataAnalyzer = new DummyDataAnalyzer();
            this.dummyDataStore = new DummyDataStore(requestRouter, publisher);
            this.dummyViewManager = new DummyViewManager(requestRouter, publisher);
        }

        public override string ID
        {
            get { return "PluginImplementationID"; }
        }

        public override string DisplayName
        {
            get { return "Plugin Implementation"; }
        }

        public override long LoaderVersionToUse
        {
            get { return 1L; }
        }

        public override List<string> Dependencies
        {
            get { return new List<string>(); }
        }

        public override List<IDataAccessor> DataAccessors
        {
            get
            {
                List<IDataAccessor> dataAccessors = new List<IDataAccessor>();
                dataAccessors.Add(this.dummyDataAccessor);
                return dataAccessors;
            }
        }

        public override List<IDataAnalyzer> DataAnalyzers
        {
            get
            {
                List<IDataAnalyzer> dataAnalyzers = new List<IDataAnalyzer>();
                dataAnalyzers.Add(this.dummyDataAnalyzer);
                return dataAnalyzers;
            }
        }

        public override List<IDataStore> DataStores
        {
            get
            {
                List<IDataStore> dataStores = new List<IDataStore>();
                dataStores.Add(this.dummyDataStore);
                return dataStores;
            }
        }

        public override List<IViewManager> ViewManagers
        {
            get
            {
                List<IViewManager> viewManagers = new List<IViewManager>();
                viewManagers.Add(this.dummyViewManager);
                return viewManagers;
            }
        }

        // TODO JTM - Need to implement these...
        public override List<IExporter> Exporters
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override List<IImporter> Importers
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        #endregion

        public override void Start()
        {
            // Nothing to do.
        }

        protected override void processRequest(
            IRequest request)
        {
            // no requests to process.
        }
    }
}
